#[macro_export]
macro_rules! ensure_not_none {
    () => {
        Ok(())
    };
    ($arg:expr) => {
        if let Some(_) = $arg {
            Ok(())
        } else {
            Err(anyhow!("Found a None value in {}", stringify!($arg)))
        }
    };
    ($first:expr, $($rest:expr),+) => {
        {
            if let Some(_) = $first {
                ensure_not_none!($($rest),+)
            } else {
                Err(anyhow!("Found a None value in {}", stringify!($first)))
            }
        }
    };
}
